<template>
    <div>
        <div class="yue">
            <div class="yue_contain">
                <div class="yue_contain_img"><img src="../../../static/images/jinbi.png" alt=""></div>
                <div class="yue_contain_mon">
                    <span>￥{{price}}</span>
                </div>
                <div class="yue_contain_mon_i">
                    <span>账户余额</span>
                </div>
            </div>
        </div>
        <div class="yue_list">
            <div class="list_i" @click="chongzhi()">
                <div><img src="../../../static/images/cz.png" alt="">
                    <span>充值</span>
                </div>
                <div><img src="../../../static/images/right.png" alt="" class="right"></div>
            </div>
            <div class="list_i" @click="tixian()">
                <div><img src="../../../static/images/tixian.png" alt="">
                    <span>提现</span>
                </div>
                <div><img src="../../../static/images/right.png" alt="" class="right"></div>
            </div>
        </div>

    </div>

</template>

<script>
import {request} from '@/wxRequest/requestApi'

export default {
	data() {
		return {
			price: '', //余额
		}
	},
	onShow() {
		this._getBalance()
	},
	methods: {
		chongzhi() {
			wx.navigateTo({url: '/pages/recharge/main'})
		},
		tixian() {
			wx.navigateTo({url: '/pages/withdraw/main'})
		},
		/**
		 * 获得余额
		 * @private
		 */
		//获取物流费
		_getBalance() {
			var userId = wx.getStorageSync('userId')
			let getParams = {
				url: '/balance/queryBalance',
				method: 'post',
				data:userId
				
			}
			this.$JZWX(getParams).then(re => {
				if (re.status === 0) {
					this.price = re.data.balance
				} else {
					this.$Message.error(re.msg)
				}
			})
		},
	},
}
</script>

<style lang="scss" scoped>
.yue {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	height: 170px;
	background: #333333;
	.yue_contain {
		img {
			width: 65px;
			height: 65px;
		}
		.yue_contain_mon {
			margin-top: 5px;
			span {
				line-height: 25px;
				font-size: 25px;
				color: #fdcb04;
			}
		}
		.yue_contain_mon_i {
			margin-top: 3px;
			color: #ebeded;
			font-size: 12px;
		}
	}
}

.yue_list {
	padding: 0 20px;
	background-color: #fff;
	.list_i {
		background: #fff;
		height: 50px;
		line-height: 50px;
		display: flex;
		justify-content: space-between;
		&:first-child {
			border-bottom: 1px solid #e1e1e1;
		}
		span {
			font-size: 14px;
			color: #323232;
			padding: 10px;
		}
		img {
			width: 24px;
			height: 24px;
			vertical-align: middle;
		}
		.right {
			width: 7px;
			height: 13px;
			text-align: right;
		}
	}
}
</style>
